package itdep.services.address;

import ga.domain.repository.EntityCriteria;
import ga.domain.repository.GenericEntityFilterProcessor;
import itdep.domain.address.District;

/**
 * @author Ivan Khalopik
 * @version $Revision: 42 $ $Date: 2010-06-25 09:12:54 +0000 (Fri, 25 Jun 2010) $
 */
public class DistrictFilterProcessor extends GenericEntityFilterProcessor<District, DistrictFilter> {

	public DistrictFilterProcessor() {
		super(District.class);
	}

	@Override
	protected void processFilter(EntityCriteria criteria, DistrictFilter filter) {
		if (filter.getRegion() != null) {
			criteria.add(criteria.getProperty(District.REGION_PROPERTY).eq(filter.getRegion()));
		}
	}
}
